home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 4 (Reseller) / Apple Ref. & Pres. Lib.v4.0.iso / 6-Apple⁄DEC Alliance / Solutions & Networking Guide / Macintosh Networking Guide / Macintosh Networking Guide / background_12680.txt < prev    next >
Text File  |  1990-04-17  |  6KB  |  228 lines

  1. -- background: 12680 from stack: in
  2. -- bmap block id: 17286
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Briefing
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global fldname
  9.   put empty into fldname
  10. end openCard
  11.  
  12. on closeCard
  13.   global fldname
  14.   if fldname <> empty
  15.   then
  16.   enterKey
  17. end if
  18. end closeCard
  19.  
  20. on enterKey
  21.   global store,fldname
  22.   set the style of cd fld id fldname to rectangle
  23.   set the lockText of cd fld id fldname to true
  24.   set the rect of cd fld id fldname to store
  25.   --put empty
  26.   --hide message
  27.   --pass enterKey
  28. end enterKey
  29.  
  30. --Grid Maker
  31. --by Ted Tripp
  32. --First Ammendment Computing
  33. --335 Swift Street
  34. --Santa Cruz, CA 95060
  35. --408 528-5293
  36. --script for creating a matrix of fields with row and column properties
  37. --each card field gets a name corrsponding to its position in the matrix
  38. --row names for fields contained in the variable, Vertical
  39. --column names for fields contained in the variable, Horizontal
  40. --Horizontal & Vertical reference bkgnd fields "Horizontal" & "Vertical"
  41.  
  42. on gone
  43.   clearfields
  44.   pasteFields
  45.   makeFields
  46.   solvesNamer
  47.   envNamer
  48. end gone
  49.  
  50. on pasteFields
  51.   --prepare card field 1, including script, font, etc
  52.   put field "Horizontal" into Horizontal
  53.   put field "Vertical" into Vertical
  54.   --makes the correct number of fields for the grid
  55.   choose field tool
  56.   click at the loc of card field 1
  57.   doMenu "Copy Field"
  58.   put the number of lines of Horizontal into Horz
  59.   put the number of lines of Vertical into Vert
  60.   repeat Horz * Vert - 1 times
  61.     doMenu "Paste Field"
  62.   end repeat
  63. end pasteFields
  64.  
  65. on makeFields
  66.   --sets up the grid
  67.   --assumes sufficient fields (using PasteFields)
  68.   --determine size of grid
  69.   put field "Horizontal" into Horizontal
  70.   put field "Vertical" into Vertical
  71.   put the number of lines of Horizontal into Horz
  72.   put the number of lines of Vertical into Vert
  73.   --set the inter-grid spacing (if any)
  74.   --first, the horizontal spacing
  75.   put the width of card field 1 + 9 into Wide
  76.   --next, the vertical spacing
  77.   put the height of card field 1 + 8 into High
  78.   --first row, initialize variables
  79.   put 1 into start
  80.   put Horz into finish
  81.   put item 1 of the rect of card field start into x1
  82.   put item 2 of the rect of card field start into y1
  83.   put item 3 of the rect of card field start into x2
  84.   put item 4 of the rect of card field start into y2
  85.   repeat with i = start to finish
  86.     set the rect of card field i to x1,y1,x2,y2
  87.     put (x1 + Wide) into x1
  88.     put (x2 + Wide) into x2
  89.   end repeat
  90.   repeat Vert-1 times
  91.     put item 1 of the rect of card field start into x1
  92.     put item 2 of the rect of card field start into y1
  93.     put item 3 of the rect of card field start into x2
  94.     put item 4 of the rect of card field start into y2
  95.     put finish + 1 into start
  96.     put finish + Horz into finish
  97.     put y1 + High into y1
  98.     put y2 + High into y2
  99.     repeat with i = start to finish
  100.       set the rect of card field i to x1,y1,x2,y2
  101.       put (x1 + Wide) into x1
  102.       put (x2 + Wide) into x2
  103.     end repeat
  104.   end repeat
  105. end makefields
  106.  
  107. on solvesNamer
  108.   --sets the column names for each field in the grid
  109.   put field "Horizontal" into Horizontal
  110.   put the number of lines of Horizontal into Horz
  111.   --sets the row names for each field in the grid
  112.   put field "Vertical" into Vertical
  113.   put the number of lines of Vertical into Vert
  114.   --initialize variables
  115.   put 1 into start
  116.   put 0 into finish
  117.   --iterative call
  118.   repeat with x = 1 to Vert
  119.     get line x of Vertical
  120.     put finish + 1 into start
  121.     put x * Horz into finish
  122.     repeat with i = start to finish
  123.       set the name of cd field i to it
  124.     end repeat
  125.   end repeat
  126. end solvesNamer
  127.  
  128. on envNamer
  129.   --sets the column names for each field in the grid
  130.   put field "Horizontal" into Horizontal
  131.   put the number of lines of Horizontal into Horz
  132.   --sets the row names for each field in the grid
  133.   put field "Vertical" into Vertical
  134.   put the number of lines of Vertical into Vert
  135.   repeat with i = 1 to Vert * Horz
  136.     put the number of card field i into fldNumber
  137.     --index by the modulus of the horizontal matrix
  138.     put fldNumber mod Horz into Indexer
  139.     if Indexer = 0 then
  140.       get the short name of card field i
  141.       put line Horz of Horizontal & space before it
  142.       set the name of card field i to it
  143.     else
  144.       get the short name of card field i
  145.       put line Indexer of Horizontal & space before it
  146.       set the name of card field i to it
  147.     end if
  148.   end repeat
  149. end envNamer
  150.  
  151. on namer
  152.   solvesNamer
  153.   envNamer
  154. end namer
  155.  
  156. on clearfields
  157.   --clears out the all the card fields
  158.   choose field tool
  159.   repeat with i = the number of card fields down to 2
  160.     click at the loc of cd fld i
  161.     doMenu "Clear Field"
  162.   end repeat
  163. end clearfields
  164.  
  165. on texter
  166.   --for fine tuning the appearance of each field in the grid
  167.   repeat with i = 1 to the number of cd flds
  168.     set the textHeight of cd fld i to 19
  169.   end repeat
  170. end texter
  171.  
  172.  
  173.  
  174.  
  175. -- part 6 (field)
  176. -- low flags: 01
  177. -- high flags: 0000
  178. -- rect: left=0 top=92 right=304 bottom=204
  179. -- title width / last selected line: 0
  180. -- icon id / first selected line: 0 / 0
  181. -- text alignment: 65535
  182. -- font id: 3
  183. -- text size: 12
  184. -- style flags: 0
  185. -- line height: 26
  186. -- part name: Vertical
  187.  
  188.  
  189. -- part 5 (field)
  190. -- low flags: 80
  191. -- high flags: 0001
  192. -- rect: left=464 top=68 right=212 bottom=508
  193. -- title width / last selected line: 0
  194. -- icon id / first selected line: 0 / 0
  195. -- text alignment: 0
  196. -- font id: 3
  197. -- text size: 9
  198. -- style flags: 0
  199. -- line height: 12
  200. -- part name: Horizontal
  201.  
  202.  
  203. -- part 19 (field)
  204. -- low flags: 01
  205. -- high flags: 0002
  206. -- rect: left=168 top=303 right=342 bottom=344
  207. -- title width / last selected line: 0
  208. -- icon id / first selected line: 0 / 0
  209. -- text alignment: 1
  210. -- font id: 242
  211. -- text size: 12
  212. -- style flags: 0
  213. -- line height: 16
  214. -- part name: Tell
  215. ----- HyperTalk script -----
  216.  
  217.  
  218. on mouseLeave
  219.   put empty into fld "Tell"
  220. end mouseLeave
  221.  
  222.  
  223. on mouseEnter
  224.   put "'Message' Field" & return & "displays information" into fld "Tell"
  225. end mouseEnter
  226.  
  227.  
  228.